package b_collection.work;

import java.util.ArrayList;
import java.util.Collection;

//测试类
public class Demo {
    public static void main(String[] args) {
        //集合中存储多部电影
        Collection<Movie> movies = new ArrayList<>();

        //往集合中添加电影对象
        movies.add(new Movie("海绵宝宝",9.7,"海绵宝宝"));
        movies.add(new Movie("霸王别姬",9.8,"张国荣"));
        movies.add(new Movie("阿甘正传",9.7,"汤姆汉克斯"));

        movies.forEach(movie -> {
            System.out.println("电影名称:" + movie.getName());
            System.out.println("电影平分:" + movie.getScore());
            System.out.println("电影主角:" + movie.getActor());
        });











    }
}
